#include<bits/stdc++.h>
using namespace std;
#define int long long
#define getchar() (p1 == p2 && (p2 = (p1 = buf1) + fread(buf1, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1++)
char buf1[1 << 23], *p1 = buf1, *p2 = buf1, ubuf[1 << 23], *u = ubuf;
namespace IO
{
	template<typename T>
	void read(T &_x){_x=0;int _f=1;char ch=getchar();while(!isdigit(ch)) _f=(ch=='-'?-1:_f),ch=getchar();while(isdigit(ch)) _x=_x*10+(ch^48),ch=getchar();_x*=_f;}
	template<typename T,typename... Args>
	void read(T &_x,Args&...others){Read(_x);Read(others...);}
	const int BUF=20000000;char buf[BUF],to,stk[32];int plen;
	#define pc(x) buf[plen++]=x
	#define flush(); fwrite(buf,1,plen,stdout),plen=0;
	template<typename T>inline void print(T x){if(!x){pc(48);return;}if(x<0) x=-x,pc('-');for(;x;x/=10) stk[++to]=48+x%10;while(to) pc(stk[to--]);}
}
using namespace IO;
const int N = 1e5+10,mod = 1e9+7;
int x,y,f[N],ans; 
signed main()
{
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	read(x),read(y);
	if(y <= 1e5)
	{
		f[x] = 1;
		for(int i = x+1;i <= y;i++) 
		{
			f[i] = f[i-1];
			if(i%2==0) f[i] += f[i/2];
			if(f[i] >= mod) f[i] -= mod;
		}
		print(f[y]); flush();
		return 0;
	}
	
	return 0;
}

